package cn.jiyun.controller;

import cn.jiyun.entity.Paper;
import cn.jiyun.entity.Quest;
import cn.jiyun.entity.Result;
import cn.jiyun.service.PaperFeignService;
import cn.jiyun.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author weiyuanhang
 * @data: 2023/8/29 002911:22
 * @Package cn.jiyun.controller
 * @email 3185757326@qq.com
 */
@RestController
@RequestMapping("/mypaper")
public class PaperController {
    @Autowired
    private PaperFeignService paperFeignService;
    @Autowired
    private PaperService paperService;




    @GetMapping("/findPaperQuest")
    public Result findPaperQuest(Integer pid) {
        return paperFeignService.findByPaperQuest(pid);
    }

    @GetMapping("/findPpaer")
    public List<Paper> findPaper(){
        return paperFeignService.findByPaper();
    }
    @PostMapping("/add")
    public Result add(@RequestBody Quest quest){

        return Result.ok(paperFeignService.add(quest));
    }
}
